{extend name="index/index"}

{block name="main"}
    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title">
            QBQ 分配角色
        </div>
        <ol class="am-breadcrumb">
            <li><a href="{:url('admin/index/index')}" class="am-icon-home">首页</a></li>
            <li><a href="{:url('admin/user/index')}">用户列表</a></li>
            <li class="am-active">分配角色</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 分配角色
                </div>

            </div>

            <div class="tpl-block">

                <div class="am-g">
                    <div class="tpl-form-body tpl-form-line">
                        <form class="am-form tpl-form-line-form" action="{:url('admin/user/doRole')}" method="post">
                            <div class="am-form-group">
                                <div class="am-u-sm-9">
                                    <input type="hidden" name="uid" value={$uid}">
                                    {foreach name="data" item="v"}
                                    {if condition="in_array($v['id'],$rid)"}
                                    <input type="checkbox" checked name="rid[]" value="{$v.id}">{$v.name}<br>
                                    {else /}
                                    <input type="checkbox" name="rid[]" value="{$v.id}">{$v.name}<br>
                                    {/if}
                                    {/foreach}
                                </div>
                            </div>

                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <button class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>


        </div>
    </div>
{/block}
